/**
 * 版权所有 (C), 2019-2019, XXX有限公司
 * 项目名：com.company.study.designpatterns.command
 * 文件名: ConcreteCommand
 * 日期: 2019/6/16 15:06
 * 说明:
 */
package com.company.study.designpatterns.command;

/**
 * @author Anbang713
 * @create 2019/6/16
 */
public class ConcreteCommand implements Command {
    //持有相应的接收者对象
    private Receiver receiver;

    /**
     * 构造方法
     */
    public ConcreteCommand(Receiver receiver) {
        this.receiver = receiver;
    }

    @Override
    public void execute() {
        //通常会转调接收者对象的相应方法，让接收者来真正执行功能
        receiver.action();
    }
}